<?php

class Silk_Application_Bootstrap extends FP_Application_Bootstrap {

    public static function Setup($pStagingEnvironment=STAGING_PRODUCTION){
	self::$_router = new Silk_Object_Router();
	self::getInstance();
	parent::Setup($pStagingEnvironment);
    }

    protected static function &GetInstance(){
	if (self::$_instance === null)
	    self::$_instance = new Silk_Application_Bootstrap(self::$_staging_environment);
	return self::$_instance;
    }

    protected function _registerSubsystem($pSubsystemName){
	self::RegisterSubsystem($pSubsystemName, 'Silk_Application_Subsystem_');
    }

    protected function loadSubsystems(){
	$this->_registerSubsystem('messaging');
	$this->_registerSubsystem('module_loader');
	$this->_registerSubsystem('site_switcher');
	$this->_registerSubsystem('asset_manager');

	parent::loadSubsystems();
    }

    protected function postInit(){
	parent::postInit();

	require_once(realpath(BASE_DIR . 'lib/Silk/View/Phptal/Custom.php'));
    }

}

?>